******************************************************************************
*                                                                            *
* Suparna Chaudhry, Sabrina Karim, and Matt Scroggs                          *
* "How Leaders' Experiences and Rebellion Shape Military Recruitment         *
* during Civil War"     													 *
* Journal of Peace Research                                                  *
*                                                                            *
******************************************************************************


* Purpose
* This is a Stata replication file for "How Leaders' Experiences and Rebellion Shape Military Recruitment during Civil War." It replicates the regressions and charts described in the original article.
*
* https://dataverse.harvard.edu/dataverse/mkscroggs
*
* Requirements
* 1. This file requires the Stata dataset "LeadMilRecruitment.dta".
* 2. This file requires Stata 12 or newer to use marginsplot.
*
* Version 1.0
* Last updated: August 10, 2020

use "LeadMilRecruitment.dta"

stset duration_year, failure(govt_pressgang)

*Table I

stcox sec_combat sec_nocombat rebel_combined

stcox sec_combat sec_nocombat rebel_combined combat milservice leveledu ///
	rebel revolutionaryleader aim ethwar magfail polity2 durest lpop lgdp ///
	midongoing colonial
	
stcox sec_combat sec_nocombat rebel_combined combat milservice leveledu ///
	rebel revolutionaryleader aim ethwar magfail polity2 durest lpop lgdp ///
	midongoing colonial change_time past_change troopqual original_recruitment

*Figure 1
sts graph, by(security_nocombat)

*Figure 2
sts graph, by(security_combat)

*Figure 3
sts graph, by(rebel_combined)

*Table II
	
stcox sec#combat rebel_combined

stcox sec#combat rebel_combined milservice leveledu rebel ///
	revolutionaryleader aim ethwar magfail polity2 durest lpop lgdp midongoing colonial

stcox sec#combat rebel_combined milservice leveledu rebel ///
	revolutionaryleader aim ethwar magfail polity2 durest lpop lgdp midongoing colonial ///
	change_time past_change troopqual original_recruitment

*Figure 4
sts graph, by(sec combat)
	
*Appendix

*Table I

stcox sec_combat#rebel_combined sec_nocombat combat milservice leveledu rebel ///
	revolutionaryleader aim ethwar magfail polity2 durest lpop lgdp midongoing colonial ///
	change_time past_change troopqual original_recruitment

*Table II

stcox sec_nocombat#rebel_combined sec_combat combat milservice leveledu rebel ///
	revolutionaryleader aim ethwar magfail polity2 durest lpop lgdp midongoing colonial ///
	change_time past_change troopqual original_recruitment

*Table III

mlogit govt_options2 sec_combat sec_nocombat rebel_combined, baseoutcome(0) ///
	cluster(conflictcode)

mlogit govt_options2 sec_combat sec_nocombat rebel_combined combat milservice ///
	leveledu rebel revolutionaryleader aim ethwar magfail polity2 durest lpop ///
	lgdp midongoing colonial, baseoutcome(0) cluster(conflictcode)

mlogit govt_options2 sec_combat sec_nocombat rebel_combined combat milservice ///
	leveledu rebel revolutionaryleader aim ethwar magfail polity2 durest lpop ///
	lgdp midongoing colonial change_time past_change troopqual ///
	original_recruitment, baseoutcome(0) cluster(conflictcode)

*Figure 1

margins, at(sec_nocombat=(0 1))

marginsplot

*Figure 2
	
margins, at(sec_combat=(0 1))

marginsplot

*Figure 3

margins, at(rebel_combined=(0 1))

marginsplot

*Note: All three figures in the paper only have outcome 0 and 3, for the reasons discussed in the paper.
